package com.mylibraryapplication.base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.mylibraryapplication.view.TitleView;

import butterknife.ButterKnife;

/**
 * @author yinsujun  Created at 2016/7/26 14:02
 * activity基类
 */
public abstract class BaseActivity extends AppCompatActivity{
    protected  final String TAG=this.getClass().getSimpleName();
    protected Context mContext;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
        ButterKnife.bind(this);
        initView();
        mContext=this;
    }

    protected void setTitle(TitleView titleView,String title){
        titleView.setTitle(title);
    }
    protected abstract int getLayoutId();
    protected abstract void initView();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
    }
}
